package com.example.demo.pojo;

import com.example.demo.pojo.group.GroupInterface1;
import com.example.demo.pojo.group.GroupInterface2;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

public class User implements Serializable {
    /**
     * 主键
     */
    //是否验证的标记为组1
    @NotNull(message = "primary is not null",groups = {GroupInterface1.class})
    private Long id;

    @Pattern(regexp = "[0123456789]",groups = {GroupInterface1.class, GroupInterface2.class},message = "hava a error Date")
    private Long maxDiscountAmount;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

    @Future(message = "expireTime is not less than now",groups = {GroupInterface1.class,GroupInterface2.class})
    @NotNull(message = "expireTime is not null",groups = {GroupInterface1.class,GroupInterface2.class})
    private Date expireTime;

}

